(|), infix ∪
ErrorsCollection

(|), infix ∪

Synthesised documentation from language/setbagmix language/operators

From language/setbagmix

See Original text in context

Returns the union of all its arguments. More information, Wikipedia definition.

From language/operators

See Original text in context

multi sub infix:<(|)>(**@p)

Union operator.

'|' as in left hand side arguments 'or' right hand side arguments.

Returns the union of all of its arguments. This creates a new Set that contains all the elements its arguments contain if none of the arguments are a Bag, BagHash, Mix or MixHash.

say <a b d>  bag(<a a b c>); # OUTPUT: «Bag(a(2) b c d)␤» 

If any of the arguments are Baggy or Mixy, the result is a new Bag (or Mix) containing all the elements, each weighted by the highest weight that appeared for that element.

say <a b d>  bag(<a a b c>); # OUTPUT: «Bag(a(2) b c d)␤»